package 代码记录.指定公司代码练习记录.西安.分值100分;

import java.util.Scanner;

/**
 * @author zx
 * @create 2023-07-02 22:18
 * 简单题：自己就做出来了
 */
public class 阿里巴巴找黄金宝箱 {//5
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] temp = str.split(",");
        int[] arr = new int[temp.length];
        for(int i = 0;i < arr.length;i++){
            arr[i] = Integer.parseInt(temp[i]);
        }
        int res = -1;
        for(int i = 0;i < arr.length;i++){
            int l = i - 1,r = i + 1;
            int leftSum = 0,rightSum = 0;
            while(l >= 0){
                leftSum += arr[l];
                l--;
            }
            while(r < arr.length){
                rightSum += arr[r];
                r++;
            }
            if(leftSum == rightSum){
                res = i;
                break;
            }
        }
        System.out.println(res);
    }
}
